// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.async.rest.actuator

import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponse
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.rest.actuator.caches.CachClearParams
import com.metest.api.models.rest.actuator.caches.CachDeleteByNameParams
import com.metest.api.models.rest.actuator.caches.CachListParams
import com.metest.api.models.rest.actuator.caches.CachListResponse
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameParams
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameResponse
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer

interface CachServiceAsync {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): CachServiceAsync

    /** Actuator web endpoint 'caches' */
    fun list(): CompletableFuture<CachListResponse> = list(CachListParams.none())

    /** @see list */
    fun list(
        params: CachListParams = CachListParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<CachListResponse>

    /** @see list */
    fun list(params: CachListParams = CachListParams.none()): CompletableFuture<CachListResponse> =
        list(params, RequestOptions.none())

    /** @see list */
    fun list(requestOptions: RequestOptions): CompletableFuture<CachListResponse> =
        list(CachListParams.none(), requestOptions)

    /** Actuator web endpoint 'caches' */
    fun clear(): CompletableFuture<Void?> = clear(CachClearParams.none())

    /** @see clear */
    fun clear(
        params: CachClearParams = CachClearParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<Void?>

    /** @see clear */
    fun clear(params: CachClearParams = CachClearParams.none()): CompletableFuture<Void?> =
        clear(params, RequestOptions.none())

    /** @see clear */
    fun clear(requestOptions: RequestOptions): CompletableFuture<Void?> =
        clear(CachClearParams.none(), requestOptions)

    /** Actuator web endpoint 'caches-cache' */
    fun deleteByName(cache: String): CompletableFuture<Void?> =
        deleteByName(cache, CachDeleteByNameParams.none())

    /** @see deleteByName */
    fun deleteByName(
        cache: String,
        params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<Void?> =
        deleteByName(params.toBuilder().cache(cache).build(), requestOptions)

    /** @see deleteByName */
    fun deleteByName(
        cache: String,
        params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
    ): CompletableFuture<Void?> = deleteByName(cache, params, RequestOptions.none())

    /** @see deleteByName */
    fun deleteByName(
        params: CachDeleteByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<Void?>

    /** @see deleteByName */
    fun deleteByName(params: CachDeleteByNameParams): CompletableFuture<Void?> =
        deleteByName(params, RequestOptions.none())

    /** @see deleteByName */
    fun deleteByName(cache: String, requestOptions: RequestOptions): CompletableFuture<Void?> =
        deleteByName(cache, CachDeleteByNameParams.none(), requestOptions)

    /** Actuator web endpoint 'caches-cache' */
    fun retrieveByName(cache: String): CompletableFuture<CachRetrieveByNameResponse> =
        retrieveByName(cache, CachRetrieveByNameParams.none())

    /** @see retrieveByName */
    fun retrieveByName(
        cache: String,
        params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<CachRetrieveByNameResponse> =
        retrieveByName(params.toBuilder().cache(cache).build(), requestOptions)

    /** @see retrieveByName */
    fun retrieveByName(
        cache: String,
        params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
    ): CompletableFuture<CachRetrieveByNameResponse> =
        retrieveByName(cache, params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        params: CachRetrieveByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CompletableFuture<CachRetrieveByNameResponse>

    /** @see retrieveByName */
    fun retrieveByName(
        params: CachRetrieveByNameParams
    ): CompletableFuture<CachRetrieveByNameResponse> = retrieveByName(params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        cache: String,
        requestOptions: RequestOptions,
    ): CompletableFuture<CachRetrieveByNameResponse> =
        retrieveByName(cache, CachRetrieveByNameParams.none(), requestOptions)

    /** A view of [CachServiceAsync] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(modifier: Consumer<ClientOptions.Builder>): CachServiceAsync.WithRawResponse

        /**
         * Returns a raw HTTP response for `get /rest/actuator/caches`, but is otherwise the same as
         * [CachServiceAsync.list].
         */
        fun list(): CompletableFuture<HttpResponseFor<CachListResponse>> =
            list(CachListParams.none())

        /** @see list */
        fun list(
            params: CachListParams = CachListParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<CachListResponse>>

        /** @see list */
        fun list(
            params: CachListParams = CachListParams.none()
        ): CompletableFuture<HttpResponseFor<CachListResponse>> =
            list(params, RequestOptions.none())

        /** @see list */
        fun list(
            requestOptions: RequestOptions
        ): CompletableFuture<HttpResponseFor<CachListResponse>> =
            list(CachListParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `delete /rest/actuator/caches`, but is otherwise the same
         * as [CachServiceAsync.clear].
         */
        fun clear(): CompletableFuture<HttpResponse> = clear(CachClearParams.none())

        /** @see clear */
        fun clear(
            params: CachClearParams = CachClearParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponse>

        /** @see clear */
        fun clear(
            params: CachClearParams = CachClearParams.none()
        ): CompletableFuture<HttpResponse> = clear(params, RequestOptions.none())

        /** @see clear */
        fun clear(requestOptions: RequestOptions): CompletableFuture<HttpResponse> =
            clear(CachClearParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `delete /rest/actuator/caches/{cache}`, but is otherwise
         * the same as [CachServiceAsync.deleteByName].
         */
        fun deleteByName(cache: String): CompletableFuture<HttpResponse> =
            deleteByName(cache, CachDeleteByNameParams.none())

        /** @see deleteByName */
        fun deleteByName(
            cache: String,
            params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponse> =
            deleteByName(params.toBuilder().cache(cache).build(), requestOptions)

        /** @see deleteByName */
        fun deleteByName(
            cache: String,
            params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
        ): CompletableFuture<HttpResponse> = deleteByName(cache, params, RequestOptions.none())

        /** @see deleteByName */
        fun deleteByName(
            params: CachDeleteByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponse>

        /** @see deleteByName */
        fun deleteByName(params: CachDeleteByNameParams): CompletableFuture<HttpResponse> =
            deleteByName(params, RequestOptions.none())

        /** @see deleteByName */
        fun deleteByName(
            cache: String,
            requestOptions: RequestOptions,
        ): CompletableFuture<HttpResponse> =
            deleteByName(cache, CachDeleteByNameParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `get /rest/actuator/caches/{cache}`, but is otherwise the
         * same as [CachServiceAsync.retrieveByName].
         */
        fun retrieveByName(
            cache: String
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>> =
            retrieveByName(cache, CachRetrieveByNameParams.none())

        /** @see retrieveByName */
        fun retrieveByName(
            cache: String,
            params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>> =
            retrieveByName(params.toBuilder().cache(cache).build(), requestOptions)

        /** @see retrieveByName */
        fun retrieveByName(
            cache: String,
            params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>> =
            retrieveByName(cache, params, RequestOptions.none())

        /** @see retrieveByName */
        fun retrieveByName(
            params: CachRetrieveByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>>

        /** @see retrieveByName */
        fun retrieveByName(
            params: CachRetrieveByNameParams
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>> =
            retrieveByName(params, RequestOptions.none())

        /** @see retrieveByName */
        fun retrieveByName(
            cache: String,
            requestOptions: RequestOptions,
        ): CompletableFuture<HttpResponseFor<CachRetrieveByNameResponse>> =
            retrieveByName(cache, CachRetrieveByNameParams.none(), requestOptions)
    }
}
